package com.xc.hotelmgr.webapi.modules.dt.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.modules.dt.entity.StoreEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;

/**
 * 分销商店铺
 * 
 * @author kemmy
 * @email kemmy@gmail.com
 * @date 2020-09-10 16:44:23
 */
@Mapper
public interface StoreDao extends BaseMapper<StoreEntity> {
    List<StoreEntity> queryPage(IPage<StoreEntity> page,@Param("dtId") Object  dtId);

    @Select("SELECT t1.*,t2.`name` as dt_name,t3.`name` as pf_name from dt_store t1,dt_dt t2,dt_store_pf t3 where t1.dt_id = t2.id and t1.blon_plantform=t3.id and t1.id = #{id}")
    StoreEntity queryById(@Param("id") Integer  id);

    List<StoreEntity> sqlSelectByDtPf(Map<String,Object> params);

    List<StoreEntity> getByDtId(Integer dtId);

    List<StoreEntity> selectByDtId(Integer dtId);

}
